/*
* $Id: Setting.h 2 2009-12-23 13:58:02Z volok-aleksej@yandex.ru $
*
* Copyright 2008 by Volokitin Alexey
* All rights reserved
*
*/
#ifndef _SETTING_H_
#define _SETTING_H_

#include "InterfaceStn.h"

class CSettings : public ISetting
{
protected:
	int m_nNameSettingsId;
	bool m_bHeader;
	std::tstring m_strRegName;
	std::map<sWindow, std::tstring> m_aWindows;
	std::map<std::tstring, std::tstring> m_aChange;
protected:
	virtual std::map<std::tstring, std::tstring> GetStates() = 0;
	virtual std::map<std::tstring, std::tstring> GetDefaultStates() = 0;
	virtual std::map<std::tstring, std::vector<Parameter> > GetParameters() = 0;
	virtual std::vector<Window> GetWindows() = 0;
	virtual std::tstring GetSaveValue(const std::tstring& strValueName, const std::tstring& strValue, bool& bSave);
	virtual void PostSave();
	void Init();
public:
	CSettings(int nIdString, const std::tstring& strRegName, bool bHeader);
	virtual ~CSettings();

	virtual std::tstring GetNameSetting();
	virtual bool IsHeader();
	virtual std::vector<sWindow*> GetDynamicInterface();
	virtual void SetState(const std::tstring& strId, const std::tstring& strState);
	virtual std::tstring GetState(const std::tstring& strId);
	virtual void CancelChange();
	virtual bool IsChanged();
	virtual void SaveSetting();
	virtual void DefaultSetting();
	virtual std::tstring GetCurrentValue(const std::tstring& strId);
	virtual std::tstring GetDefaultValue(const std::tstring& strId);
	virtual void Free();
};

#endif /*_SETTING_H_*/